<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org" lang="zh-CN" class="translated-ltr">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>AdminLTE 2 | Boxed Layout</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <!-- Bootstrap 3.3.7 -->
  <link rel="stylesheet" href="../../bower_components/bootstrap/dist/css/bootstrap.min.css">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="../../bower_components/font-awesome/css/font-awesome.min.css">

    <link rel="stylesheet" href="/layui/css/layui.css">
  <!-- Ionicons -->
  <link rel="stylesheet" href="../../bower_components/Ionicons/css/ionicons.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="../../dist/css/AdminLTE.min.css">
  <!-- AdminLTE Skins. Choose a skin from the css/skins
       folder instead of downloading all of them to reduce the load. -->
  <link rel="stylesheet" href="../../dist/css/skins/_all-skins.min.css">
  <link rel="stylesheet" href="../../css/index.css">

  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>

  <![endif]-->

  <!-- Google Font -->
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
</head>
<!-- ADD THE CLASS layout-boxed TO GET A BOXED LAYOUT -->
<body class="hold-transition skin-blue layout-boxed sidebar-mini">
<!-- Site wrapper -->
<div class="wrapper">

  <header class="main-header">
    <!-- Logo -->
    <a class="logo">
      <!-- mini logo for sidebar mini 50x50 pixels -->
          <img src="images/icon.jpg" STYLE="max-width: 50px" class="img-circle" alt="User Image"></span>
      <!-- logo for regular state and mobile devices -->
    </a>
    <!-- Header Navbar: style can be found in header.less -->
    <nav class="navbar navbar-static-top" style="max-height: 50px">
      <!-- Sidebar toggle button-->
      <div style="display: inline-block;text-align: center;margin-left: 80px">
          <div class="btn-group" id="main-nav">
              <button type="button" class="btn btn-info">同城书架</button>
              <button type="button" class="btn btn-info">松书商城</button>
              <button type="button" class="btn btn-info">搜索书籍</button>
              <button type="button" class="btn btn-info">智能推荐</button>
          </div>
      </div>
      <div style="display: inline-block; float: right;">
        <div class="navbar-custom-menu" th:if="${username}">
          <ul class="nav navbar-nav">
            <!-- Messages: style can be found in dropdown.less-->
            <!-- Notifications: style can be found in dropdown.less -->
            <li class="dropdown notifications-menu">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                <i class="fa fa-bell-o"></i>
                <span class="label label-warning">10</span>
              </a>
              <ul class="dropdown-menu">
                <li class="header">You have 10 notifications</li>
                <li>
                  <!-- inner menu: contains the actual data -->
                  <ul class="menu">
                    <li>
                      <a href="#">
                        <i class="fa fa-users text-aqua"></i> 5 new members joined today
                      </a>
                    </li>
                  </ul>
                </li>
                <li class="footer"><a href="#">View all</a></li>
              </ul>
            </li>
            <!-- Tasks: style can be found in dropdown.less -->
            <!-- User Account: style can be found in dropdown.less -->
            <li class="dropdown user user-menu">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                <img src="../../dist/img/user2-160x160.jpg" class="user-image" alt="User Image">
                <span class="hidden-xs">Alexander Pierce</span>
              </a>
              <ul class="dropdown-menu">
                <!-- User image -->
                <li class="user-header">
                  <img src="../../dist/img/user2-160x160.jpg" class="img-circle" alt="User Image">

                  <p>
                    Alexander Pierce - Web Developer
                    <small>Member since Nov. 2012</small>
                  </p>
                </li>
                <!-- Menu Body -->
                <li class="user-body">
                  <div class="row">
                    <div class="col-xs-4 text-center">
                      <a href="#">Followers</a>
                    </div>
                    <div class="col-xs-4 text-center">
                      <a href="#">Sales</a>
                    </div>
                    <div class="col-xs-4 text-center">
                      <a href="#">Friends</a>
                    </div>
                  </div>
                </li>
                <!-- Menu Footer-->
                <li class="user-footer">
                  <div class="pull-left">
                    <a href="#" class="btn btn-default btn-flat">Profile</a>
                  </div>
                  <div class="pull-right">
                    <a href="#" class="btn btn-default btn-flat">Sign out</a>
                  </div>
                </li>
              </ul>
            </li>
            <!-- Control Sidebar Toggle Button -->
          </ul>
        </div>
          <div id="login-box" th:if="!${username}">
              <div class="btn-group">
                  <button  type="button" class="btn btn-success loginBtn">登陆</button>
                  <button type="button" class="btn btn-success regisBtn">注册</button>
              </div>
          </div>
      </div>
    </nav>
  </header>

  <!-- =============================================== -->

  <!-- Left side column. contains the sidebar -->


  <!-- =============================================== -->

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper" style="margin-right: 200px">
    <!-- Content Header (Page header) -->
    <section class="content-header">

    </section>

    <!-- Main content -->
    <section class="content">
    </section>

    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->
    <div id="friend-sidebar" class="layui-bg-gray">
        <div>
            <ul id="friend-list">
                <li class="user-ol">
                    <div class="user-panel">
                        <div class="pull-left image">
                            <img src="../../dist/img/user2-160x160.jpg" class="img-circle" alt="用户图片">
                        </div>
                        <div class="pull-left info">
                            <p>亚历山大·皮尔斯</p>
                            <a href="#"><i class="fa fa-circle text-success"></i> 线上</a>
                        </div>
                    </div>
                </li>
            </ul>
        </div>
        <div class="input-group input-group-sm">
            <input type="text" class="form-control">
            <span class="input-group-btn">
                      <button type="button" class="btn btn-info btn-flat"> 搜索用户</button>
            </span>
        </div>
    </div>
    <aside class="main-sidebar" style="background-color: #ecf0f5;">
        <div id="user-info" th:if="${username}">
        <div class="box box-widget widget-user-2">
            <!-- Add the bg color to the header using any of the bg-* classes -->
            <div class="widget-user-header bg-white">
                <div class="widget-user-image">
                    <img class="img-circle" src="../dist/img/user7-128x128.jpg" alt="用户头像">
                </div>
                <!-- /.widget-user-image -->
                <h3 class="widget-user-username"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">娜迪亚·卡迈克尔（Nadia Carmichael）</font></font></h3>
                <h5 class="widget-user-desc"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">首席开发人员</font></font></h5>
            </div>
            <div class="box-footer no-padding">
                <ul class="nav nav-stacked">
                    <li><a href="#"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">研究计画</font></font><span class="pull-right badge bg-blue"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">31</font></font></span></a></li>
                    <li><a href="#"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">任务</font></font><span class="pull-right badge bg-aqua"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">5</font></font></span></a></li>
                    <li><a href="#"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">已完成的项目</font></font><span class="pull-right badge bg-green"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">12</font></font></span></a></li>
                    <li><a href="#"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">关注</font></font><span class="pull-right badge bg-red"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">人数842</font></font></span></a></li>
                </ul>
            </div>
        </div>
        <div class="box box-primary">
            <div class="box-header with-border">
                <h3 class="box-title"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">关于我</font></font></h3>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
                <strong><i class="fa fa-book margin-r-5"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> 教育</font></font></strong>

                <p class="text-muted"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">
                    田纳西大学诺克斯维尔分校计算机科学学士学位
                </font></font></p>

                <hr>

                <strong><i class="fa fa-map-marker margin-r-5"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> 地点</font></font></strong>

                <p class="text-muted"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">加利福尼亚马里布</font></font></p>

                <hr>

                <strong><i class="fa fa-pencil margin-r-5"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> 技能专长</font></font></strong>

                <p>
                    <span class="label label-danger"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">UI设计</font></font></span>
                    <span class="label label-success"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">编码</font></font></span>
                    <span class="label label-info"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">Javascript </font></font></span>
                    <span class="label label-warning"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">PHP </font></font></span>
                    <span class="label label-primary"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">Node.js</font></font></span>
                </p>

                <hr>

                <strong><i class="fa fa-file-text-o margin-r-5"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> 笔记</font></font></strong>

                <p><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">Lorem ipsum dolor坐下，一直保持着安静的状态。</font><font style="vertical-align: inherit;">Etiam fermentum enim neque。</font></font></p>
            </div>
            <!-- /.box-body -->
        </div>
        </div>
        <div id="" th:if="!${username}" style="text-align: center;padding-top:50px;padding-bottom: 130%;background-color: #5bc0de">
            <img class="img-circle" style="max-width: 230px" src="images/squirrel.jpg">
            <div style="margin-top: 50px;color: white;font-weight: bold;font-size: 27px">
            请<span class="regisBtn">注册账号</span>
            <hr>
            已有账号请<span class="loginBtn">登陆</span>
            </div>
        </div>
    </aside>
</div>
<!-- ./wrapper -->
<script src="jquery/dist/jquery.min.js"></script>
<script src="layui/layui.js"></script>
<!-- jQuery 3 -->
<!-- Bootstrap 3.3.7 -->
<script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- SlimScroll -->
<script src="bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script>
<!-- FastClick -->
<script src="bower_components/fastclick/lib/fastclick.js"></script>
<!-- AdminLTE App -->
<script src="dist/js/adminlte.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="dist/js/demo.js"></script>

<script src="commonjs/createFriendList.js">
</script>
<script src="commonjs/util.js"></script>
<script>
    layui.use('element', function(){
        var element = layui.element;
        //…
    });
    layui.use('layer', function(){
        var layer = layui.layer;
    });
</script>
<script>
    // 如果当前用户已登陆
    if(getCookie("loginedUsername")) {
        getFriendList(getCookie("loginedUserid"), $("#friend-list"));
    }
    //如果当前用户未登陆
    else {
        $(".loginBtn").click(function () {
            layer.open({
                type:2,
                skin:'layui-layer-movl',
                content:['page/login/form','no'],
                area:['400px','250px'],
                title:false,
                closeBtn:1
            })
        })
        $(".regisBtn").click(function () {
            layer.open({
                type: 2,
                skin: 'layui-layer-movl',
                content:['page/register/form','no'],
                area:['600px','600px'],
                title:false,
                closeBtn:1,
            })
        })
    }
    function registHandle() {
        layer.open({
            type: 2,
            skin: 'layui-layer-movl',
            content:['page/register/form','no'],
            area:['600px','600px'],
            title:false,
            closeBtn:1,
        })
    }
    function loginHandle() {
        layer.open({
            type:2,
            skin:'layui-layer-movl',
            content:['page/login/form','no'],
            area:['400px','250px'],
            title:false,
            closeBtn:1
        })
    }
</script>
</body>
</html>
